﻿using System.Reflection;

namespace Borg
{
    internal class OpenSlotTask : Task<SlotInfo>
    {
        private readonly bool _isManual;

        public OpenSlotTask(SlotInfo obj, bool isManual,
            uint taskGroupId, Assembly initiator)
            : base(obj, taskGroupId, initiator)
        {
            _isManual = isManual;
        }

        public override void Execute()
        {
            obj.InternalOpen(_isManual, taskGroupId, initiator, true);
        }

        public override string ToString()
        {
            return string.Format("{0}: {1}.InternalOpen()", taskGroupId, obj);
        }

        public override string Name
        {
            get { return string.Format("OpenSlot({0})", obj.Name); }
        }
    }
}

